<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>H+移动工作平台 - 资产处置申请</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <link rel="stylesheet" href="../css/styles.css">
</head>
<body>
  <div class="device-container">
    <!-- 状态栏 -->
    <div class="status-bar">
      <div class="status-bar-left">
        <span class="time">9:41</span>
      </div>
      <div class="status-bar-right">
        <i class="fas fa-signal signal"></i>
        <i class="fas fa-wifi wifi"></i>
        <i class="fas fa-battery-full battery"></i>
      </div>
    </div>
    
    <!-- 导航栏 -->
    <div class="nav-bar">
      <div class="nav-left">
        <a href="asset.html"><i class="fas fa-arrow-left"></i></a>
      </div>
      <div class="nav-title">资产处置申请</div>
      <div class="nav-right">
        <i class="fas fa-question-circle"></i>
      </div>
    </div>
    
    <!-- 内容区域 -->
    <div class="app-content">
      <!-- 表单区域 -->
      <div class="p-4">
        <form id="disposalForm">
          <!-- 资产选择 -->
          <div class="form-group">
            <label class="form-label">选择资产</label>
            <div class="input-group" id="assetSelector">
              <input type="text" readonly placeholder="点击选择需要处置的资产" class="form-input">
              <i class="fas fa-chevron-right text-gray-400"></i>
            </div>
          </div>
          
          <!-- 处置类型 -->
          <div class="form-group">
            <label class="form-label">处置类型</label>
            <div class="grid grid-cols-3 gap-2">
              <div class="radio-card">
                <input type="radio" name="disposalType" id="scrap" value="scrap" checked>
                <label for="scrap">
                  <div class="radio-icon bg-red-100">
                    <i class="fas fa-trash-alt text-red-500"></i>
                  </div>
                  <div class="radio-text">报废</div>
                </label>
              </div>
              
              <div class="radio-card">
                <input type="radio" name="disposalType" id="sell" value="sell">
                <label for="sell">
                  <div class="radio-icon bg-green-100">
                    <i class="fas fa-tag text-green-500"></i>
                  </div>
                  <div class="radio-text">出售</div>
                </label>
              </div>
              
              <div class="radio-card">
                <input type="radio" name="disposalType" id="donate" value="donate">
                <label for="donate">
                  <div class="radio-icon bg-blue-100">
                    <i class="fas fa-gift text-blue-500"></i>
                  </div>
                  <div class="radio-text">捐赠</div>
                </label>
              </div>
            </div>
          </div>
          
          <!-- 处置原因 -->
          <div class="form-group">
            <label class="form-label">处置原因</label>
            <textarea class="form-textarea" rows="4" placeholder="请详细描述资产处置原因..."></textarea>
          </div>
          
          <!-- 处置方式（出售时显示） -->
          <div class="form-group disposal-sell-fields" style="display: none;">
            <label class="form-label">出售方式</label>
            <select class="form-select">
              <option value="">请选择出售方式</option>
              <option value="auction">公开拍卖</option>
              <option value="direct">直接出售</option>
              <option value="trade-in">折价置换</option>
            </select>
          </div>
          
          <!-- 预计价格（出售时显示） -->
          <div class="form-group disposal-sell-fields" style="display: none;">
            <label class="form-label">预计价格（元）</label>
            <input type="number" class="form-input" placeholder="请输入预计出售价格">
          </div>
          
          <!-- 接收单位（捐赠时显示） -->
          <div class="form-group disposal-donate-fields" style="display: none;">
            <label class="form-label">接收单位</label>
            <input type="text" class="form-input" placeholder="请输入接收单位名称">
          </div>
          
          <!-- 上传照片 -->
          <div class="form-group">
            <label class="form-label">资产现状照片</label>
            <div class="grid grid-cols-4 gap-2">
              <div class="upload-box">
                <input type="file" id="photoUpload" accept="image/*" multiple hidden>
                <label for="photoUpload" class="upload-label">
                  <i class="fas fa-camera"></i>
                  <span>上传</span>
                </label>
              </div>
            </div>
          </div>
          
          <!-- 处置时间 -->
          <div class="form-group">
            <label class="form-label">预计处置时间</label>
            <input type="date" class="form-input">
          </div>
          
          <!-- 提交按钮 -->
          <div class="mt-8">
            <button type="submit" class="btn-primary w-full">提交申请</button>
          </div>
        </form>
      </div>
    </div>
    
    <!-- 底部标签栏 -->
    <div class="tab-bar">
      <a href="home.html" class="tab-item">
        <i class="fas fa-home tab-icon"></i>
        <span>首页</span>
      </a>
      <a href="asset.html" class="tab-item active">
        <i class="fas fa-laptop tab-icon"></i>
        <span>资产</span>
      </a>
      <a href="finance.html" class="tab-item">
        <i class="fas fa-wallet tab-icon"></i>
        <span>财务</span>
      </a>
      <a href="material.html" class="tab-item">
        <i class="fas fa-box tab-icon"></i>
        <span>物资</span>
      </a>
      <a href="profile.html" class="tab-item">
        <i class="fas fa-user tab-icon"></i>
        <span>我的</span>
      </a>
    </div>
  </div>
  
  <!-- 资产选择模态框 -->
  <div class="modal" id="assetModal">
    <div class="modal-content">
      <div class="modal-header">
        <div class="modal-title">选择资产</div>
        <button class="modal-close"><i class="fas fa-times"></i></button>
      </div>
      <div class="modal-body">
        <div class="search-box mb-4">
          <i class="fas fa-search search-icon"></i>
          <input type="text" placeholder="搜索资产编号或名称" class="search-input">
        </div>
        <div class="asset-list">
          <div class="asset-item" data-id="A2023001">
            <div class="asset-info">
              <div class="asset-name">联想ThinkPad X1 Carbon</div>
              <div class="asset-meta">编号: A2023001 | 状态: 在用</div>
            </div>
            <div class="asset-select">
              <i class="fas fa-check-circle"></i>
            </div>
          </div>
          <div class="asset-item" data-id="A2023002">
            <div class="asset-info">
              <div class="asset-name">戴尔 OptiPlex 7080</div>
              <div class="asset-meta">编号: A2023002 | 状态: 在用</div>
            </div>
            <div class="asset-select">
              <i class="fas fa-check-circle"></i>
            </div>
          </div>
          <div class="asset-item" data-id="A2023003">
            <div class="asset-info">
              <div class="asset-name">惠普 LaserJet Pro M428fdw</div>
              <div class="asset-meta">编号: A2023003 | 状态: 在用</div>
            </div>
            <div class="asset-select">
              <i class="fas fa-check-circle"></i>
            </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button class="btn-secondary" id="cancelAssetSelect">取消</button>
        <button class="btn-primary" id="confirmAssetSelect">确定</button>
      </div>
    </div>
  </div>
  
  <script>
    // 处置类型切换
    document.querySelectorAll('input[name="disposalType"]').forEach(radio => {
      radio.addEventListener('change', function() {
        // 隐藏所有特定字段
        document.querySelectorAll('.disposal-sell-fields, .disposal-donate-fields').forEach(el => {
          el.style.display = 'none';
        });
        
        // 根据选择显示对应字段
        if (this.value === 'sell') {
          document.querySelectorAll('.disposal-sell-fields').forEach(el => {
            el.style.display = 'block';
          });
        } else if (this.value === 'donate') {
          document.querySelectorAll('.disposal-donate-fields').forEach(el => {
            el.style.display = 'block';
          });
        }
      });
    });
    
    // 资产选择模态框
    const assetSelector = document.getElementById('assetSelector');
    const assetModal = document.getElementById('assetModal');
    const cancelAssetSelect = document.getElementById('cancelAssetSelect');
    const confirmAssetSelect = document.getElementById('confirmAssetSelect');
    
    assetSelector.addEventListener('click', function() {
      assetModal.classList.add('active');
    });
    
    cancelAssetSelect.addEventListener('click', function() {
      assetModal.classList.remove('active');
    });
    
    confirmAssetSelect.addEventListener('click', function() {
      const selectedAsset = document.querySelector('.asset-item.selected');
      if (selectedAsset) {
        const assetName = selectedAsset.querySelector('.asset-name').textContent;
        assetSelector.querySelector('input').value = assetName;
      }
      assetModal.classList.remove('active');
    });
    
    // 资产项选择
    document.querySelectorAll('.asset-item').forEach(item => {
      item.addEventListener('click', function() {
        document.querySelectorAll('.asset-item').forEach(el => {
          el.classList.remove('selected');
        });
        this.classList.add('selected');
      });
    });
    
    // 表单提交
    document.getElementById('disposalForm').addEventListener('submit', function(e) {
      e.preventDefault();
      alert('资产处置申请已提交，等待审批');
      // 实际应用中这里应该有AJAX请求提交表单数据
    });
  </script>
</body>
</html>